<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>通过标签名获得元素</title>
</head>
<body>
<div>你好</div>
<div>1</div>
<div>2</div>
<div>3</div>
<script>
  //获取全部的这个标签 如果没有返回空 获得的也是文档流中的元素
  var eles = document.getElementsByTagName('div');
  console.log(eles);
</script>
</body>
</html>